package jp.sourceforge.akjrcp.videotools.subtitlemaker;



import org.eclipse.draw2d.Figure;
import org.eclipse.swt.widgets.Display;

public class FigureUtils {
	public static void syncRepaintFigure(Display display,Figure figure){
		display.syncExec(new RepaintFigure(figure));
	}
	 public  static class AddFigure extends Thread{
		 private SelectableFigureList parent;
		 private Figure figure;
		 public AddFigure(SelectableFigureList parent,Figure figure){
			 this.parent=parent;
			 this.figure=figure;
		 }
		 public void run(){
			 parent.addFigure(figure);
			 parent.revalidate();//?
		 }
	 }
	public static void syncAddFigure(Display display,SelectableFigureList parent,Figure children){
		display.syncExec(new AddFigure(parent,children));
	}
	 public  static class RepaintFigure extends Thread{

		 private Figure figure;
		 public RepaintFigure(Figure figure){
		
			 this.figure=figure;
		 }
		 public void run(){
		figure.repaint();
		 }
	 }
}
